package com.mysen.sso.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mysen.sso.dao.mapper.RoleMapper;
import com.mysen.sso.model.Role;

@Repository
public class RoleDao {
	
	@Autowired
	private RoleMapper mapper;
	
    public List<Role> selectByPage(Role record){
        return mapper.selectByPage(record);
    }
    
    public Integer selectByPageCount(Role record){
    	return mapper.selectCount(record);
    }

    public List<Role> selectBy(Role t){
    	return mapper.selectByPage(t);
    }	
    
    public int deleteById(String id){
        return mapper.deleteById(id);
    }

    public int insert(Role record){
        return mapper.insert(record);
    }

    public Role selectById(String id){
        return mapper.selectById(id);
    }

    public int updateById(Role record){
        return mapper.updateById(record);
    }
    
    public int addPermissions(Role record){
    	return mapper.addPermissions(record);
    }

	public List<Role> selectTree(String pid) {
		return mapper.selectTree(pid);
	}
}
